package we.common;


public class CDebug
{

    public static final EEnviroment enviroment = EEnviroment.DEBUG;
    //public static final boolean DEBUG = true;
    public static final boolean DEBUG = (enviroment == EEnviroment.DEBUG || enviroment == EEnviroment.PRIVATE);

//    public static void Trace(Object msg)
//    {
//        if (DEBUG)
//        {
//            System.out.println(msg);
//        }
//    }
    public static void Trace(String tag, Object msg)
    {
        if (DEBUG)
        {
            System.out.println(tag + " : " + msg);
        }
    }

    public static void Trace(Object MyObject, Object msg)
    {
        Trace(MyObject.getClass().getSimpleName(), msg);
    }

    public static void Trace(Class MyClass, Object msg)
    {
        Trace(MyClass.getName(), msg);
    }

    public static void Error(Object object, Exception ex)
    {
        Error(object.getClass().getSimpleName(), ex);
    }
    
    public static void Error(String tag, Exception ex)
    {
        System.out.print(tag + " : ");
        ex.printStackTrace();
    }
}
